<include file="Public:header" />
<!-- nice-scroll -->
<script src="__PUBLIC__/style/js/plugins/nice-scroll/jquery.nicescroll.min.js" type="text/javascript"></script>
<script type="text/javascript" src="__PUBLIC__/style/js/TableFreeze.js"></script>
<script src="__PUBLIC__/js/chart/highcharts.js"></script>
<script src="__PUBLIC__/js/chart/modules/exporting.js"></script>
<link href="__PUBLIC__/css/litebox.css" rel="stylesheet" type="text/css">
<style>
	body{
		overflow-y: hidden;
	}
	table tr td{min-width: 50px;}
	table tr {height: 50px;text-align: center;}
	#oDivL_tab_Test3{background-color: #fff;z-index: inherit !important;}
	.table{max-width: none;}
	.tabTh{background-color: #fff;}

	#right-sidebar-log{
		width: 50% !important;
		right: -60%;
		background-color: #fff;
	    overflow: hidden;
	    position: fixed;
	    top: 60px;
	    z-index: 1009;
	    bottom: 0;
	    box-shadow: 0px 2px 1px #888888;
	}
	.ibox-span{
		float: left;
		line-height: 30px;
	}
</style>
<script>
$(function(){
	var scroll_width = 10;
	$("#table_div").height(window.innerHeight-$("#table_div").offset().top-$("#tfoot_div").height()-20);
	$(window).resize(function(){
		$("#table_div").height(window.innerHeight-$("#table_div").offset().top-$("#tfoot_div").height()-20);
		$("#oDivL_tab_Test3").height($("#table_div").height()-scroll_width-1).width($("#oTableLH_tab_Test3").width());
		$("#oDivH_tab_Test3").height($("#oTableLH_tab_Test3").height()).width($("#table_div").width()-scroll_width);
	});
	$(".nicescroll").niceScroll({
		cursorcolor: "#999",//#CC0071 光标颜色 
	    cursoropacitymax: 0.4, //改变不透明度非常光标处于活动状态（scrollabar“可见”状态），范围从1到0 
	    touchbehavior: false, //使光标拖动滚动像在台式电脑触摸设备 
	    cursorwidth: scroll_width+"px", //像素光标的宽度 
	    cursorborder: "0", //     游标边框css定义 
	    cursorborderradius: "3px",//以像素为光标边界半径 
	    autohidemode: false, //是否隐藏滚动条 
	    zindex:100,
	    background:"#F3F3F5",//滚动条背景色
	});
	<if condition = "$_GET['content_id'] eq '' || $_GET['content_id'] eq 1">
		$("#tab_Test3").FrozenTable(1,0,5);
	<else />
		$("#tab_Test3").FrozenTable(1,0,3);
	</if>
	
	$("#oDivL_tab_Test3").height($("#table_div").height()).width($("#oTableLH_tab_Test3").width());
	$("#oDivH_tab_Test3").height($("#oTableLH_tab_Test3").height()).width($("#table_div").width());
})

</script>
<div class="wrapper wrapper-content ">
	<div class="row">
		<div class="col-lg-12">
			<div class="ibox float-e-margins">
				<include file="Public:analytics_left" />
				<input type="hidden" id="type_id" value="{$type_id}">
				<input type="hidden" id="content_id" value="{$content_id}">

				<div class="col-lg-10">
					<div class="ibox-content" style="padding-bottom:10px;border-bottom: none;">
						<include file="Public:alert" />
						<div class="row">
							<div class="col-lg-2">
								<div class="pull-left" >
									<span style="font-size: 18px;color: #000;">
										<if condition = "$_GET['content_id'] eq 1">
											日志统计分析
										<else />
											跟进分析
										</if>
									</span>
								</div>
							</div>
							<div class="col-lg-6">
								<ul class="nav pull-left" style="margin:2px 0 0 15px;">
									<li>
										<div class="input-group">
											<select name="search_year" id="search_year" class="form-control search_time" >
												<volist name="year_array" id="vo">
													<option value="{$vo}" <if condition = "$search_time_year eq $vo">selected</if>>{$vo}年</option>
												</volist>
											</select>
										</div>
									</li>
								</ul>
								<ul class="nav pull-left" style="margin:2px 0 0 15px;">
									<li>
										<div class="input-group">
											<select name="search_month" id="search_month" class="form-control search_time" >
												<volist name="month_array" id="vo">
													<option value="{$vo}" <if condition = "$search_time_month eq $vo">selected</if>>{$vo}月</option>
												</volist>
											</select>
										</div>
									</li>
								</ul>
							</div>
							<div class="col-lg-4">
								<if condition = "$_GET['content_id'] eq 1">
									<div class="pull-right" >
										<div class="table-content" style="font-size: 12px;">
											<div class="ibox-span">
												<span class="fa fa-circle" style="color:#FFB07B;"></span>
												<span>已点评</span>
											</div>
											<div class="ibox-span">
												<i class="fa fa-check" style="color: #1ab394;"></i>
												<span>已提交</span>
											</div>
											<div class="ibox-span">
												<i class="fa fa-close" style="color: #ed5565;"></i>
												<span>未提交</span>
											</div>
										</div>
									</div>
								</if>
							</div>
						</div>
					</div>
					<div class="ibox-content " id="right_height" style="border-top: none;">
						<if condition = "$content_id eq 1">
							<input type="hidden" id="is_show" value="0"/>
							<div class="th_content" style="position:relative;">
								<div id="table_div" class="nicescroll" >
									<table class="table table-hover table-striped table_thead_fixed table-bordered" id="tab_Test3" >
										<tr class="tabTh" >
											<td style="min-width:170px;padding-left: 15px;text-align: left;">员工</td>
											<td>本月</td>
											<td>完成率</td>
											<td>本年</td>
											<td>完成率</td>
											<td style="max-width: 30px;"></td>
											<for start="1" end="$days" comparison="elt" step="1" name="a" >
										    	<td style="width: 50px;<if condition="in_array($a,$week_array)">color:#ed5565 !important;</if>" ><if condition ="strlen($a) eq 1">0</if>{$a}</td>
			    							</for>
			    							<td></td>
										</tr>
										<volist name="role_list" id="vo">
											<tr>
												<td style="padding-left: 15px;text-align: left;">
													<a class="role_info" rel="{$vo.role_id}" href="javascript:void(0)">
													<if condition="$vo['thumb_path']">
														<img class="img-circle" style="width:32px;height:32px;" src="{$vo['thumb_path']}"/>
													<else/>
														<img class="img-circle" style="width:32px;height:32px;" src="__PUBLIC__/img/avatar_default.png"/>
													</if>
													<span>{$vo['full_name']}</span>
													</a>
												</td>
												<td>{$vo['month_count']}</td>
												<td>{$vo['month_rate']}%</td>
												<td>{$vo['year_count']}</td>
												<td>{$vo['year_rate']}%</td>
												<td></td>
												<volist name="vo['log_type']" id="voo">
													<td>
														<if condition = "$voo['log_ids'] neq ''">
															<a class="right-sidebar-toggle-log" href="javascript:void(0)" rel="{$voo['log_ids']}" title="点击查看详情">
																<i class="fa fa-check" style="font-size: 18px;color: #1ab394;"></i>
																<if condition = "$voo['is_comment'] eq 1">
																	<div style="height: 6px;width: 6px;border-radius: 50%;background-color: #FFB07B;position: relative;top: 0px;right: -5px;"></div>
																<else />
																	<div style="height: 6px;width: 6px;position: relative;top: 0px;right: -5px;"></div>
																</if>
															</a>
														<else />
															<if condition = "$voo['type'] eq 2" >
																<i class="fa fa-close" style="font-size: 18px;color: #ed5565;"></i>
															<elseif condition = "$voo['type'] eq 3" />
																<span style="color: #868a8d;height: 30px;width: 30px;border-radius: 50%;background-color: #e4eaec;text-align: center;display:block;padding:6px 0;" title="休息">休息</span>
															<elseif condition = "$voo['type'] eq 4" />
																<a target="_blank" href="{$voo['url']}">
																	<span style="color: #fff;height: 30px;width: 30px;border-radius: 50%;background-color: #FFBDBD;text-align: center;display:block;padding:6px 0;" title="请假">请假</span>
																</a>
															<elseif condition = "$voo['type'] eq 5" />
																<a target="_blank" href="{$voo['url']}">
																	<span style="color: #fff;height: 30px;width: 30px;border-radius: 50%;background-color: #FFE0B3;text-align: center;display:block;padding:6px 0;" title="出差">出差</span>
																</a>
															</if>
														</if>
													</td>
												</volist>
											</tr>
										</volist>
									</table>
								</div>
								<div id="tfoot_div" class="clearfix">
									<div class="clearfix" id="tfoot_page">
										{$page}
									</div>
								</div>
							</div>
							<elseif condition = "$content_id eq 2" />
							<div class="th_content" style="position:relative;">
								<div id="table_div" class="nicescroll">
									<table class="table table-hover table-striped table_thead_fixed table-bordered" id="tab_Test3" >
										<tr class="tabTh">
											<td style="min-width:170px;padding-left: 15px;">员工</td>
											<td>本月提交</td>
											<td>本年提交</td>
											<for start="1" end="$days" comparison="elt" step="1" name="a" >
										    	<td style="width: 50px;" <if condition="in_array($a,$week_array)">color:#ed5565 !important;</if> ><if condition ="strlen($a) eq 1">0</if>{$a}</td>
			    							</for>
			    							<td style="max-width: 30px;"></td>
										</tr>
										<tbody>
											<volist name="role_list" id="vo">
												<tr>
													<td style="padding-left: 15px;">
														<a class="role_info" rel="{$vo.role_id}" href="javascript:void(0)">
															<if condition="$vo['thumb_path']">
																<img class="img-circle" style="width:32px;height:32px;" src="{$vo['thumb_path']}"/>
															<else/>
																<img class="img-circle" style="width:32px;height:32px;" src="__PUBLIC__/img/avatar_default.png"/>
															</if>
															<span>{$vo['full_name']}</span>
														</a>
													</td>
													<td>{$vo['month_count']}</td>
													<td>{$vo['year_count']}</td>
													<volist name="vo['log_count']" id="voo">
														<td>
															<if condition = "$voo['count'] eq 0 && $voo['lt_time'] eq 1">
																<i class="fa fa-close" style="font-size: 18px;color: #ed5565;"></i>
															<elseif condition = "$voo['count']" />
																<a href="javascript:void(0);" class="commun_list" rel="{$vo.role_id}" rel1="{$voo['sdate']}" >{$voo['count']}</a>
															</if>
														</td>
													</volist>
													<td></td>
												</tr>
											</volist>
										</tbody>
									</table>
								</div>
								<div id="tfoot_div" class="clearfix">
									<div class="clearfix" id="tfoot_page">
										{$page}
									</div>
								</div>
							</div>
						</if>
						<div class="clearfix"></div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<link href="__PUBLIC__/css/litebox.css" rel="stylesheet" type="text/css">
<script src="__PUBLIC__/js/litebox.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/js/images-loaded.min.js" type="text/javascript"></script>

<div class="" style="display:none;" id="dialog-role-info" title="{:L('USER_INFO')}">
	<div class="spiner-example">
        <div class="sk-spinner sk-spinner-three-bounce">
            <div class="sk-bounce1"></div>
            <div class="sk-bounce2"></div>
            <div class="sk-bounce3"></div>
        </div>
    </div>
</div>
<div class="" style="display:none;" id="dialog-commun_list" title="沟通记录">
	<div class="spiner-example">
        <div class="sk-spinner sk-spinner-three-bounce">
            <div class="sk-bounce1"></div>
            <div class="sk-bounce2"></div>
            <div class="sk-bounce3"></div>
        </div>
    </div>
</div>
<script type="text/javascript">
	$(".search_time").change(function(){
		var search_year = $('#search_year').val();
		var search_month = $('#search_month').val();
		var type_id = "{$_GET['type_id']}";
		var content_id = "{$_GET['content_id']}";  
		window.location.href="{:U('log/analytics','&type_id=')}"+type_id+'&content_id='+content_id+'&search_year='+search_year+'&search_month='+search_month+'&department=all&role=all';
	});

	$("#dialog-role-info").dialog({
		autoOpen: false,
		modal: true,
		width: 600,
		maxHeight: 550,
		position: ["center",100]
	});
	
	$(".role_info").click(function(){
		$role_id = $(this).attr('rel');
		$('#dialog-role-info').dialog('open');
		$('#dialog-role-info').load('{:U("user/dialoginfo","id=")}'+$role_id);
	});

	$("#dialog-commun_list").dialog({
		autoOpen: false,
		modal: true,
		width: 600,
		maxHeight: 550,
		position: ["center",100]
	});

	$(".commun_list").click(function(){
		var role_id = $(this).attr('rel');
		var sdate = $(this).attr('rel1');
		$('#dialog-commun_list').dialog('open');
		$('#dialog-commun_list').load('{:U("log/commun_list","role_id=")}'+role_id+'&search_time='+sdate);
	});
</script>
<script>
	$(function(){
		$("#edit_log").click(function(){
			window.location.href="{:U('log/mylog_edit','&id=')}"+$(this).attr('rel');
		})
	});
	/*日志详情 加载的圈圈效果*/
	var detail_html = '<div class="spiner-example">\
						<div class="sk-spinner sk-spinner-fading-circle">\
							<div class="sk-circle1 sk-circle"></div>\
							<div class="sk-circle2 sk-circle"></div>\
							<div class="sk-circle3 sk-circle"></div>\
							<div class="sk-circle4 sk-circle"></div>\
							<div class="sk-circle5 sk-circle"></div>\
							<div class="sk-circle6 sk-circle"></div>\
							<div class="sk-circle7 sk-circle"></div>\
							<div class="sk-circle8 sk-circle"></div>\
							<div class="sk-circle9 sk-circle"></div>\
							<div class="sk-circle10 sk-circle"></div>\
							<div class="sk-circle11 sk-circle"></div>\
							<div class="sk-circle12 sk-circle"></div>\
						</div>\
					</div>';

	//鼠标点击空白处，隐藏右侧滑出
	document.onmousedown=function(event){
		if($(".litebox-overlay").length > 0) return;
		if(event.target.className == 'right-sidebar-toggle-log') return;

	    var div = document.getElementById("right-sidebar-log");
	    var x=event.clientX;
	    var y=event.clientY;
	    var divx1 = div.offsetLeft;
	    var divy1 = div.offsetTop;
	    var divx2 = div.offsetLeft + div.offsetWidth;
	    var divy2 = div.offsetTop + div.offsetHeight;
	    if( x < divx1 || x > divx2 || y < divy1 || y > divy2){
	        if($("#right-sidebar-log").css('right') == '0px'){
	            $("#right-sidebar-log").animate({right:'-60%'}, 400);
	            //$('#is_show').val('0');
	        }
	    }
	}
	//日志详情弹出
	$(document).on('click','.right-sidebar-toggle-log',function(){
		var log_id = $(this).attr('rel');
		var is_show = document.getElementById("is_show").value;

		if($("#right-sidebar-log").css('right') != '0px'){
			$("#right-sidebar-log").animate({right:'0px'}, 600);
		}
			
	    $('#log-content').html(detail_html);
	    $('#sidebar-container').load("{:U('log/viewAjax','log_id=')}"+log_id);
	});
</script>
<div id="right-sidebar-log">
	<!--the css for jquery.mCustomScrollbar-->
	<link rel="stylesheet" href="__PUBLIC__/emoji/css/jquery.mCustomScrollbar.min.css"/>
	<!--the css for this plugin-->
	<link rel="stylesheet" href="__PUBLIC__/emoji/css/jquery.emoji.css"/>
	<!--(Optional) the js for jquery.mCustomScrollbar's addon-->
	<script src="__PUBLIC__/emoji/js/jquery.mousewheel-3.0.6.min.js"></script>
	<!--the js for jquery.mCustomScrollbar-->
	<script src="__PUBLIC__/emoji/js/jquery.mCustomScrollbar.min.js"></script>
	<!--the js for this plugin-->
	<script src="__PUBLIC__/emoji/js/jquery.emoji.js"></script>

	<div class="sidebar-container" id="sidebar-container">
		
	</div>
</div>
<include file="Public:footer" />